package com.zhu.work;

import com.github.benmanes.caffeine.cache.LoadingCache;

public class YmsFileCache {
    private LoadingCache<String, YmsFileBuffer> ymsCache;

    private YmsFileCache(){
        this.ymsCache =  CacheBuilder.getResourcesCache();
    }

    private static class CacheHolder{
        private static  YmsFileCache INSTANCE = new YmsFileCache();
    }

    public static YmsFileCache getInstance(){
        return CacheHolder.INSTANCE;
    }

    public YmsFileBuffer getFileBufferByFilePath(String path){
        return this.ymsCache.get(path);
    }

}
